<template>
  <div class="list">
    <div class="pager-title">{{$route.meta.title}}</div>
    <el-table
      :data="tableData"
      v-loading="isLoading"
      @sort-change="sortList"
      style="width: 100%; margin-top: 15px;">
      <el-table-column
        align="center"
        prop="id"
        sortable="custom"
        label="ID">
      </el-table-column>
      <el-table-column
        align="center"
        prop="contract_name"
        sortable="custom"
        label="合同名称">
      </el-table-column>
      <el-table-column
        align="center"
        sortable="custom"
        prop="contract_no"
        label="合同编号">
      </el-table-column>
      <el-table-column
        align="center"
        sortable="custom"
        show-overflow-tooltip
        prop="time_end"
        :formatter="formatTime"
        label="合同到期时间">
      </el-table-column>
      <el-table-column
        align="center"
        sortable="custom"
        show-overflow-tooltip
        prop="time_add"
        :formatter="formatTime"
        label="发起时间">
      </el-table-column>
      <el-table-column
        align="center"
        sortable="custom"
        show-overflow-tooltip
        prop="status_sign"
        label="合同状态">
      </el-table-column>
      <!-- <el-table-column
        align="center"
        show-overflow-tooltip
        prop="address"
        label="合同类型">
      </el-table-column> -->
      <el-table-column
        align="center"
        width="180px"
        label="操作">
        <template slot-scope="scope">
          <el-button size="mini" type="primary" @click="doSign(scope.row)">签署</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @current-change="handleCurrentChange"
      :current-page.sync="pageIndex"
      :page-size="pageSize"
      layout="total, prev, pager, next, jumper"
      :total="totalCount">
    </el-pagination>
  </div>
</template>
<script>
import tableMixin from '@/common/mixins/tableData'
export default {
  name: 'list',
  mixins: [tableMixin],
  data() {
    return {
      listApi: '/company/contract/get'
    }
  },
  methods: {
    doSign(row) {
      console.log(row)
    }
  }
}
</script>